Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 8 - TCP/IP Services / TCP/IP Services Reference
Functions / Address Utilities


OTInetGetInterfaceInfo

Returns internet address information about the local host.

C INTERFACE
OSStatus OTInetGetInterfaceInfo (InetInterfaceInfo *info,
                                 SInt32 val);
C++ INTERFACE
None. C++ clients use the C interface to this function.

PARAMETERS
info
A pointer to an InetInterfaceInfo structure. You must allocate this structure. The function fills in such information as the internet address, subnet mask, broadcast address, MTU, and DNS address for the internet interface indicated by the index parameter.
val
An index into the local host's array of configured IP interfaces. Specify 0 for information about the first interface. Specify kDefaultInetInterface to get information about the primary interface.
DESCRIPTION
Because the architecture of Open Transport TCP/IP provides for multihoming, in principle a given host can receive packets simultaneously through more than one network interface. For each IP interface configured for the local host, the OTInetGetInterfaceInfo function provides the internet address and subnet mask, a default gateway (that is, a gateway, if any exists, that can be used to route any packet to all destinations outside the locally connected subnet), and a domain name server, if any is known. The function also returns the version number of the OTInetGetInterfaceInfo function and, if available, the broadcast address for each interface. If the broadcast address is not available, you can determine it from the internet address and subnet mask.

Note
Because multihoming has not been implemented
in the initial release of Open Transport, the OTInetGetInterfaceInfo function never returns information for more than one interface.
SPECIAL CONSIDERATIONS
If Open Transport TCP/IP has not yet been loaded into memory, the OTInetGetInterfaceInfo function returns no valid interfaces. Open Transport TCP/IP is not loaded until a TCP/IP application is running unless the user has selected "TCP always loaded" in the TCP/IP control panel.

The OTInetGetInterfaceInfo function cannot block and always runs synchronously.

SEE ALSO
The InetInterfaceInfo structure is described in "Internet Interface Information Structure" on page 8-25.

See "OTBind" on page 8-15 for information on binding an endpoint to all configured IP interfaces.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996